import React, {Component} from 'react';

class Add extends Component {

    addCounter(counter) {
        console.log(this.props.onChange)
        this.props.onChange(counter)
        console.log(counter)
    }

    render() {
        return (
            <div>
                <button onClick={() => this.addCounter(1)}>+1</button>
                <button onClick={() => this.addCounter(5)}>+5</button>
                <button onClick={() => this.addCounter(10)}>+10</button>
            </div>
        );
    }
}

export default Add;